// 工作计划:日，周，月，季度
import { role } from '@/utils/const/constant'

export default (layout) => {
  return {
    path: '/workplan',
    component: layout,
    redirect: '/workplan/day',
    meta: {
      title: 'workplan',
      icon: 'work',
      roles: [role.admin, role.manager, role.user]
    },
    children: [
      {
        path: '/workplan/day',
        component: () =>
          import(/* webpackChunkName: "workplan" */ '@/views/workplan/day'),
        name: 'workplanDay',
        meta: {
          title: 'dayplan',
          icon: 'ribao',
          roles: [role.admin, role.manager, role.user]
        }
      },
      {
        path: '/workplan/week',
        component: () =>
          import(/* webpackChunkName: "workplan" */ '@/views/workplan/week'),
        name: 'workplanWeek',
        meta: {
          title: 'weekplan',
          icon: 'zhoubao',
          roles: [role.admin, role.manager, role.user]
        }
      },
      {
        path: '/workplan/month',
        component: () =>
          import(/* webpackChunkName: "workplan" */ '@/views/workplan/month'),
        name: 'workplanMonth',
        meta: {
          title: 'monthplan',
          icon: 'yuebao',
          roles: [role.admin, role.manager]
        }
      },
      {
        path: '/workplan/quarter',
        component: () =>
          import(/* webpackChunkName: "workplan" */ '@/views/workplan/quarter'),
        name: 'workplanQuarter',
        meta: {
          title: 'quarterplan',
          icon: 'mubiao',
          roles: [role.admin, role.manager]
        }
      },
      {
        path: '/workplan/year',
        component: () =>
          import(/* webpackChunkName: "workplan" */ '@/views/workplan/year'),
        name: 'workplanYear',
        meta: {
          title: 'yearplan',
          icon: 'mubiao1',
          roles: [role.admin, role.manager]
        }
      }
    ]
  }
}
